import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:finance_app/src/widgets/select/mixin/radio_mixin.dart';
import 'package:finance_app/src/widgets/wrapper/normal_form_wrapper.dart';
import 'package:flutter/material.dart';

class SetSalaryPeriodRadio extends StatelessWidget with RadioMixin {
  final String title;
  final String content;
  final bool isSelect;

  const SetSalaryPeriodRadio({
    Key key,
    this.title,
    this.isSelect,
    this.content,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return NormalFormWrapper(
      topPadding: getDp(18),
      bottomPadding: getDp(18),
      leftPadding: getDp(35),
      rightPadding: getDp(35),
      child: Row(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          buildSelectWidget,
          SizedBox(
            width: getDp(13),
          ),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [
                SizedBox(
                  height: getDp(4),
                ),
                Text(
                  title,
                  style: TextStyle(
                    color: aceBlackColor,
                    fontSize: getSp(18),
                    fontWeight: isSelect ? FontWeight.w700 : FontWeight.w400,
                    height: 14 / 18,
                  ),
                ),
                if (title != S.current.custom) AppSpaces.h10,
                if (title != S.current.custom)
                  Text(
                    content,
                    style: TextStyle(
                      color: isSelect ? aceBlackColor : aceGrayColor,
                      fontSize: getSp(16),
                      fontWeight: FontWeight.w400,
                      height: 14 / 16,
                    ),
                  ),
                if (title != S.current.custom)
                  SizedBox(
                    height: getDp(4),
                  ),
                if (title != S.current.custom)
                  Container(
                    width: getDp(200),
                    height: getDp(0.5),
                    color: aceGrayColor,
                  ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
